	<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
	<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
	<%@ taglib uri="/timefunction" prefix="tmf"%>
<c:set var="comLen" value="${fn:length(curArticle.comments)}"></c:set>
<c:set var="comments" value="${curArticle.comments}" />
<h3 id="comments">

	<c:choose>
		<c:when test="${comLen<1}">
	No Responses
	</c:when>
		<c:when test="${comLen==1}">
	One Response
	</c:when>
		<c:when test="${comLen>1}">
	${comLen} Responses
	</c:when>
	</c:choose>

	to &ldquo;${curArticle.title }&rdquo;
</h3>
<c:if test="${comLen>0}">
	<ol class="commentlist">

	<c:forEach items="${comments}" var="comment">
		<li class="alt" id="comment-${comment.id}">
			<img alt='' src='${pageContext.request.contextPath}/content/themes/holiday-resort-10/images/headicon.JPG' class='avatar avatar-32 photo' height='32' width='32' />			
			<cite><a href="${comment.url }">${comment.author }</a></cite> Says:
						<br />
					
			<small class="commentmetadata"><a href="#comment-2" title="">${tmf:getFormateTimeStr('%Mc %De,%Y at %T12 %Nc',comment.postTime) }</a> &nbsp;&nbsp;
			 <c:if test="${adminIsLogin!=null}">
									&#183;
								<a class="comment-edit-link" href="${pageContext.request.contextPath}/admin/comments" title="编辑评论">edit</a>
								</c:if> 
			</small>

			<p>${comment.content }</p>

		</li>
</c:forEach>
	</ol>
</c:if>
<!-- 评论验证 -->
<script type="text/javascript" src="${pageContext.request.contextPath}/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/content/js/validity_check.js"></script>

<h3 id="respond">Leave a Reply</h3>
<c:choose>

 <c:when test="${adminIsLogin!=null}"><!-- 管理员 -->	
<form action="${pageContext.request.contextPath}/blog/comment.do?article_id=${curArticle.id}" method="post" id="commentform">
<p>Logged in as <a href="#">admin</a>.
<p><input type="hidden" name="author" id="author" value="${adminIsLogin.name }"  size="22" tabindex="1" /></p>
<p><input type="hidden" name="email" id="email" value="${adminIsLogin.email }" size="22" tabindex="2"  />
<p><textarea name="content" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
</p>

	<input type="hidden" name="method" value="addComment" />
</form>
</c:when>

<c:otherwise>
<form action="${pageContext.request.contextPath}/blog/comment.do?article_id=${curArticle.id}" method="post" id="commentform"
onsubmit="return check()">
<p><input type="text" name="author" id="author" value="${curGuest.name }"  size="22" tabindex="1"  />
<label for="author"><small>Name (required)</small></label></p>
<p><input type="text" name="email" id="email" value="${curGuest.email }" size="22" tabindex="2"  />
<label for="email"><small>Mail (will not be published) (required)</small></label></p>

<p><input type="text" name="url" id="url" value="${curGuest.url }" size="22" tabindex="3" />
<label for="url"><small>Website</small></label></p>

<p><textarea name="content" id="comment" cols="10" rows="10" tabindex="4"></textarea></p>
	<script type="text/javascript">
				//<![CDATA[

					// This call can be placed at any point after the
					// <textarea>, or inside a <head><script> in a
					// window.onload event handler.

					// Replace the <textarea id="editor"> with an CKEditor
					// instance, using default configurations.
					CKEDITOR.replace( 'comment' ,{
      						 toolbar : 'Basic',
    					     uiColor : '#F8EED2'
   						 });

				//]]>
				
				</script>

<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
<input type="hidden" name="comment_post_ID" value="56" />
</p>
	<input type="hidden" name="method" value="addComment" />
</form>
</c:otherwise>
</c:choose>	
